<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String basePath = request.getScheme() + "://" + request.getServerName()
			+ ":" + request.getServerPort() + request.getContextPath();
%>
<jsp:include page="/WEB-INF/page/auth/_header.jsp"></jsp:include>
<body>
	<jsp:include page="/WEB-INF/page/auth/header.jsp"></jsp:include>
	<div id="middle">
		<jsp:include page="/WEB-INF/page/auth/menu.jsp"></jsp:include>
		<div id="right">
			<div id="online_repair_regtb">
		        <form id="online_repair_regForm" class="m5">
		                             学期：
		            <select class="form-control1" name="termId" id="termId"></select>
		                              报修时间：
		            <input class="easyui-datebox form-control1" name="startDate" id="startDate"> - <input class="easyui-datebox form-control1" name="endDate" id="endDate">
					<input type="hidden" id="schoolId" name="schoolId" value=""/>
		            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-search'" onclick="searchForm('online_repair_reg')">查询</a>
		            <a class="easyui-linkbutton l-btn l-btn-small" data-options="iconCls:'icon-clear'" onclick="resetForm1('online_repair_reg')">重置</a><br/>
		        </form>
		    </div>
		    <table id="online_repair_regdg">
		        <thead>
		            <tr>
		                <th data-options="field:'id',checkbox:true"></th>
		                <th data-options="field:'termName',title:'学期名称'"></th>
		                <th data-options="field:'repairName',title:'报修人'"></th>
		                <th data-options="field:'repairPhone',title:'报修人电话'"></th>
		                <th data-options="field:'repairType',title:'报修类别'"></th>
		                <th data-options="field:'buildingName',title:'建筑物'"></th>
		                <th data-options="field:'buildingNumber',title:'楼层'"></th>
		                <th data-options="field:'repairPlace',title:'报修地点'"></th>
		                <th data-options="field:'faultDesc',title:'故障描述',width:200,
		                formatter: function(value, row, index) {
		                    return '<span class=\'note\' title=\''+(value?value:'')+'\'>'+ value + '</span>';
		                }"></th>
		                <th data-options="field:'repairTime',title:'报修时间',formatter: function(value, row, index) {
		                	return getTime(value,'yyyy-MM-dd hh:mm:ss');
		                }"></th>
		                <th data-options="field:'repaireStatus',title:'维修状态',formatter: function(value, row, index) {
		                    if(value == '001') return '待维修';
		                    else if(value == '000') return '已维修';
		                    else return '';
		                }"></th>
		                <th data-options="field:'repaireName',title:'维修人'"></th>
		                <th data-options="field:'repairePhone',title:'维修人电话'"></th>
		                <th data-options="field:'repaireReply',title:'维修回复',width:200,
		                formatter: function(value, row, index) {
		                    return '<span class=\'note\' title=\''+value+'\'>'+ (value?value:'') + '</span>';
		                }"></th>
		                <th data-options="field:'replyTime',title:'回复时间',formatter: function(value, row, index) {
		                	return getTime(value,'yyyy-MM-dd hh:mm:ss');
		                }"></th>
		            </tr>
		        </thead>
		    </table>
		</div>
	</div>
	<jsp:include page="/WEB-INF/page/auth/_footer.jsp"/>
	<script type="text/javascript">
		$(function(){
	        var url = basePath + "/sys/repair/query";
	        initSchoolIdValue();
	        initDatagrid("online_repair_reg",url);
	        termList("online_repair_reg");
	    });
	    function buildingFloorList(record){
	        var url="onlineRepair/repair_building_conf/buildingFloor?name=" + record.value;
	        var ed=$('#online_repair_regdg').datagrid('getEditor',{index:dgEditIndex['online_repair_reg'],field:'楼层'});
	        var row = $('#online_repair_regdg').datagrid("getSelections")[0];
	        $(ed.target).combobox('setValue', row ? row.楼层 : "");
	        $(ed.target).combobox('reload',url);
	    }
	    function resetForm1(cf){
	        $("#" + cf + "Form")[0].reset();
	        $("#" + cf + "Form #startDate").datebox('setValue', null);
	        $("#" + cf + "Form #endDate").datebox('setValue', null);
	    }
    </script>
</body>
</html>